#ifndef ROUNDPROGRESSBAR_H
#define ROUNDPROGRESSBAR_H

#include<QWidget>
class RoundProgressBar:public QWidget
{
    Q_OBJECT
    Q_PROPERTY(float m_value READ getMValue WRITE setMValue)
public:
    RoundProgressBar(QWidget *parent=0);
    float getMValue();
    void setValue(float val);
    void setInColor(const QColor& col);
    void setOutColor(const QColor& col);

protected:
    void paintEvent(QPaintEvent *event) override;
    void resizeEvent(QResizeEvent *event) override;
private:
    void setMValue(float val);
    void PaintText(QPainter &painter);
    void PaintInnerBar(QPainter &painter);
    void PaintOutterBar(QPainter &painter);
private:
    float m_sqaureside;
    float m_sqaurepoint;
    QColor m_inColor;
    QColor m_outColor;
    float m_inBarwidth;
    float m_outBarwidth;
    int m_startAngler;
    float m_value;
    float m_min;
    float m_max;
};

#endif // ROUNDPROGRESSBAR_H
